/* EasyWay Game Engine
 * Copyright (C) 2006 Daniele Paggi.
 *  
 * Written by: 2006 Daniele Paggi<dshnt@hotmail.com>
 *   
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 * 
 * You should have received a copy of the GNU Library General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
package org.easyway.lists;

import java.io.Serializable;

import org.easyway.interfaces.extended.ILoopable;

/** gestore delle liste degli sprite (AUTO-USATO DAL SIS. G) */
public class LoopList extends BaseList<ILoopable> implements ILoopable,
		Serializable {
	static final long serialVersionUID = 101;

	/** creates a new instance of LoopList */
	public LoopList() {
		super();
	}

	/** creates a new instance of LoopList */
	public LoopList(boolean toadd) {
		super(toadd);
	}

	// -----------------------------------------

	/** loops all sprites */
	public void loop() {
		ILoopable lobj;
		for (indexScan = size() - 1; indexScan >= 0; --indexScan) {
			lobj = get(indexScan);
			// if (lobj == null)
			// continue;
			assert lobj != null : "null object in the LoopList!";
			lobj.loop();
		}
		indexScan = -1;
	}
}